using Volo.Abp.ObjectMapping;

namespace Shared.Mapster;

public class MapsterObjectMapper : IObjectMapper
{
    private readonly IAutoObjectMappingProvider _autoObjectMappingProvider;

    public MapsterObjectMapper(IAutoObjectMappingProvider autoObjectMappingProvider)
    {
        _autoObjectMappingProvider = autoObjectMappingProvider;
    }

    public IAutoObjectMappingProvider AutoObjectMappingProvider => _autoObjectMappingProvider;

    public TDestination Map<TSource, TDestination>(TSource source)
    {
        return _autoObjectMappingProvider.Map<TSource, TDestination>(source);
    }

    public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
    {
        return _autoObjectMappingProvider.Map<TSource, TDestination>(source, destination);
    }
}